module.exports = async (fastify, opts) => {
  fastify.get(
    '/',
    {
      schema: {
        query: {
          type: 'object',
          properties: {
            sn: { type: 'string' },
          },
          required: ['sn'],
        },
      },
    },
    async (request, reply) => {
      const data = await fastify.invokeCloudFunction(
        'list-all-task',
        request.query
      )
      reply.send(data)
    }
  )
}
